/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cz.mzk.oai.metadataRepository.repository.depricatedItem;

import cz.mzk.oai.metadataRepository.repository.depricatedItem.Item;
import cz.mzk.oai.metadataRepository.metadata.MetadataFormat;
import cz.mzk.oai.metadataRepository.repository.Identifier;
import java.io.IOException;
import java.util.List;

/**
 *
 * @author Martin Rehanek (rehan at mzk.cz)
 */
public interface ItemsManager {

    public boolean containsItem(Identifier id);

    public Item createItem(Identifier id);

    public Item getItem(Identifier id);

    public List<Item> getItems(MetadataFormat metadataFormat);

    public Iterable<Item> getAllItems();

    public int size();

    /**
     *
     * @param item
     * @throws Exception if item is not found
     */
    public void updateItem(Item item);

    public Item removeItem(Identifier id);

    /**
     * Should be called after finished working with collection
     * TODO: remove from interface. Use only in PropertiesBaseItemsManager
     */
    void persistItems() throws IOException;
}
